<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html> <head>
<title>testMyJs Testbed</title>
<link rel="stylesheet" href="test.css" />
<style>
  #results td {
    vertical-align: top;
  }
</style>
</head>

<body>
<h1>testMyJs Testbed</h1>
<input type="button" id="btnRunTests" value="Run Tests" />
<table id="results">
  <tr>
    <td id="assertion-results"></td>
    <td id="mocking-results"></td>
  </tr>
</table>

<script type="text/javascript" src="../src/assertions.js"></script>
<script type="text/javascript" src="../src/runner.js"></script>
<script type="text/javascript" src="../src/reporter.js"></script>
<script type="text/javascript" src="../src/mocking.js"></script>
<script type="text/javascript" src="assertion-test.js"></script>
<script type="text/javascript" src="mocking-test.js"></script>
<script type="text/javascript">
var main = (function(that) {

  return function() {
    var tests = [
      { namespace: 'AssertionTests', results: 'assertion-results' },
      { namespace: 'MockingTests', results: 'mocking-results' }
    ];

    for (var i = 0, len = tests.length; i < len; ++i) {
      var test = tests[i];
      var runner = new TestRunner(test.namespace);
      var result = runner.runAllTestsInNameSpace();
      var reporter = new TestReporter(result);
      reporter.buildResultTable(document.getElementById(test.results));
    }
  };
})(this);

document.getElementById('btnRunTests').onclick = main;
</script>
</body> </html>
